package com.nave.segundaguerra.activity;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class GenNamesList extends BaseAdapter {

	private Context context;
	private List<NamesList> nameList;
	
	public GenNamesList(Context context,List<NamesList> nameList) {
		this.context = context;
		this.nameList = nameList;
	}

	public int getCount() {
		return nameList.size();
	}

	public Object getItem(int position) {
		return nameList.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		NamesList member = nameList.get(position);
		
		LayoutInflater inflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View view = inflater.inflate(com.example.honraepodercliente.R.layout.activity_credits, null);

		TextView name = (TextView) view.findViewById(com.example.honraepodercliente.R.id.credits_name);
		TextView function = (TextView) view.findViewById(com.example.honraepodercliente.R.id.credits_function);

		name.setText(member.getMember());
		function.setText(member.getFunction());
		
		return view;
	}

}
